change updating of the records from HoA to HoH so that is done in one loop.