Template figured out for parsing

Almost ready to merge changes into master brance