Tested all the code with Findbugs and fixed some minor things. Also, the
basic structure of the writing to file is working too.