Cleaned up parts of the code (thanks Ai4rei). Updated README.md a bit.