Added a popCount function.