added a sorting function, along with an algorith that builds each nodes logical equation

calls back earlier node equations for end node equations
added function that creates a list of logic functions for each node

done by use of for loops

will try to do by recursion to find only top node equations