First attempt at code.  Conceptually pretty much there, just needs some threading fun. "Just".