lots of changes, finally redeisnged motif_tree_problem correctly