Updated to print total count
Updated unit-test