bugfix on hammingdistance + added method hammingweight on a substring