preliminary code for p124.  It works, but runs faaaaaaar too slow.