Added more documentation and fixed a few public->protected problems