dumped buggy Sedgewick code
using clearer version
seems to work; needs breakout into main, test.c, etc.