optimize the HAMMING WETGHT