Removed some unused code, added some docstrings