added a bunch of logic to make a functional machine; added DDT tests to machine template