Updated with docstrings