changed Map to work with MapObjects
removed unused code