Code to scale to different resolutions