first version to count and batch count
tests will to be removed later