made some progress with templating, need to reconcile javascript....