best sequence in 2d array