added mapObjects function