Removed strange counting logic len(list()) and replaced with count().