merged in some changes from crosslink viewer