implemented my-count function