changed gitignore to ignore output
merged commits
replaced occurrences of '.txt' with a constant
Refactored some code and fixed some bugs; use RandomAccessFile for writing all files again because there were encoding problems with the other solution