main function being implemented.