updated map_to_array in model.py