Added in concurrency code from Dan Grahn