Changed identation to tabs
Added braces to if statements, to all but the simple breaks
Removed unused variable
Changed spaces for tabs
Updated function declaration style to ANSI
Added ignore for build files
Merge pull request #2 from leon9/master

Cleaned code and updated the function definition