added docstrings to functions, removed last of scaffolding