added map drawing function