Added a function countNumberOfBits()