Simpler threading

This version seems to work and is simpler.