Implemented the screen size calculation into main