Added docstrings
tidying up