Fixed errors with how fractions were computed

Now this gives the same results as the python version, at least for the
couple of tests that I performed.
Solution to challenge 20

Had to find the key for the first letter separately since there are
different letter frequencies at the beginnings of words.