returned main function