applied Peter Hartlich's patch regarding aspect calculation with slight modifications