function to fill across rows then backfill missing rows