Updated functions and the global *db* to use docstrings instead of comments