Added the context class and modified the map class