Changed public functions to private and added some documentation.