Count function

A small addition to add the count function