changed optimize from running after every update_release to after the 5th loop