Added getCount method