Working functions tested with Gregory Horne's (TA) template tests.