code: public static int[] setSteps(Last[][][] traceback, boolean local, int[] xyMax, Last last, List<Step> sx,
  			List<Step> sy) {
  		int x = xyMax[0], y = xyMax[1];
  		boolean linear = (traceback[x][y].length == 1);
  		while (local ? (linear ? last : traceback[x][y][last.ordinal()]) != null : x > 0 || y > 0) {
  			switch (last) {
  			case DELETION:
  				sx.add(Step.COMPOUND);
  				sy.add(Step.GAP);
  				last = linear ? traceback[--x][y][0] : traceback[x--][y][1];
  				break;
  			case SUBSTITUTION:
  				sx.add(Step.COMPOUND);
  				sy.add(Step.COMPOUND);
  				last = linear ? traceback[--x][--y][0] : traceback[x--][y--][0];
  				break;
  			case INSERTION:
  				sx.add(Step.GAP);
  				sy.add(Step.COMPOUND);
  				last = linear ? traceback[x][--y][0] : traceback[x][y--][2];
  			}
  		}
  		Collections.reverse(sx);
  		Collections.reverse(sy);
  		return new int[] {x, y};
  	}
docs: Find alignment path through traceback matrix
  @param traceback
  @param local
  @param xyMax
  @param last
  @param sx
  @param sy
  @return