add templating
support algebraic selection modifications
remove some stdout debugging