modified map editor with some bugs