Added some docstrings + privatized some functions