incorporate empty object for counting char occurences
move var declaration outside of loop
working function passes all tests
add clearer variable names
clean version
merge hash solution with master branch