Refactored code to comply with Java standards

Some code was a bit too iffy. (A variable called count should probably
not be a String)