tests passing except for on tree_machine bug. not testing return values yet