acomplish main function