Update test files
Add inner workings. Add docstrings.