Changed execution order to match enki's internal loop