change private to protected functions, add public to functions