cleaned code in drawMap