changed print statements to be only in the main program