modified JosephDScriptTree.k