added a method to constrain aspect ratio