Hamming: Updated example and changed exercise to use a function