This looks like a problem to me...you don't have an array called $newOrder anymore, so I don't see how the reassignment of the order numbers can work.  Looks like you need to go off the newListOrder and newFormOrder arrays instead.