All functions/methods have return statements, amended docstrings, added quit option to query.