added XRES and YRES environment variables.