fixed bug with formatting stats and resists

added docstrings to all functions