Commented some methods, and changed a switch statement to an if-else chain