simplified count method in model (removed useless parameters)