used tr to strip the carriage return and end of file characters