Removed commented out code (doesn't work)

Also removed unused variables.