Caught some errors and cleaned up commented code