re-imagining of path gen code. still in progress