added support for non-square screen sizes