Implementing count2