Refactored to remove i as a variable

Not the best practice when assigning values to alphabet
And added more code from book