added counting of set bits in an integer