added count operation but this implementation need double check