add count and count_where methods