Prototype Code

First pass adapting from Brian Gladman’s code … Needs testing