Added count functionality