Implemented the method inMap()