[UPDATE] added Hamming distance.