Work with bidimensional data, instead of an array, work with a matrix in order to select items below or above.