Added support for variable screen sizes.