added source_tree, related methods and a test