added unix line terminator to output
added docstrings