refactored the front end, implementing EnhancedMap class