enormous refactor to introduce sleep-ch.  doesn't work as planned yet.