Added docstrings
minor: fix code formatting