Changes to update loop