updated count method