started go and python versions
refactor; py can print matrix
passes treeify