cleaned endemic counter and added new convenience function