Attempted to improve the aspect ratio algorithm.