Implement size() method.