Use the save function I gave you. Adapt it to use the the MapRec type.