Move main function to last called file in load order