main function creation