refactored map
fixed mapeditor bug