implmented hamming and goal