Added Map.h and refactored