added comments, renamed some methods for clarity. removed unneeded code.
converted test files to proper encoding for my code.