Reduced last if statement to one-liner for hamming dist accumulation