2d compare computation