changing map function to handle new schema