added hemming distance