added a wrapper function for transition where we can hook up the dfa stuff.
cleaned up some commented code
Added comments and added node_transition