short version of for/if combo and made hamming dist a separate file