modify Map.java, MiniMap.java and add some helper classes