replaced hash with map