Changed private functions to protected for extending