This needs its own thread.