Implement the __len__ method