pairwise and refined transforms for edge, rmste code start: