Changed validation and timeout checks to instead raise exceptions.
2opt. Moved swap to only run once.