Threading

Oops, forgot to push the changes that were supposed to be brought in with #4.