optimized more code to draw tiles