Added code to correctly draw an environment with custom width and height