refactored some stuff;
 - setwarnings fixed (bug)
 - return int instaed of assigning int (more logical)
 - initial variable assignments (condensed code)
 - whitespace (remove tab)