Added Javadoc, made for-loop Java5 style
Update imports
Migrated long if-then-else statement into a more compact java7 'switch' statement
Restructuring the class