fixed build_score_tree