added getCount method