Update to most recent main function