cleaned up the code and removed a print statement