added a main function for chooks