Changed alphabets.
Rewrote program as function.
Fixed typo.