removed all of the printfs from the function