reimplemented count operation