Renamed attributes to attribute_map, and fixed bug arising from last change
Refactored