pselect not doing what I hoped it would
almost have something passable