Working version with most test coverage. Still want to test more around various configs