Converted usage of count function of the STD library to my util function.