made Pivot class, continued cleanup & docstrings