Parse main function