pmatch based expansion working

This is working, should let me build ladders of states of
a given number of steps.