More style cleanup; added docstrings