Fixed Map and removed unused code