replaced points counting with _.reduce()