Added get_stats

- Added docstrings and made some general readability fixes.