Adds Grid#hamming_weight