Adding documentation and making some more things private