Replaced all .count instances for |length to prevent naming collisions