created main function