Removed xres and yres globals