Changed identation to tabs
Added braces to if statements, to all but the simple breaks
Removed unused variable