code formatted
corrected the names of traversal methods