handle all the work