more optimizations
now running at 13.5 frames per second instead of 9.5