aspect ratio logic begin