Added putStrLn and used it in the correct places