added missing docstrings, and fixed a bug that got merged in from testing