added better count implementation