main function renamed