airline seat algorithm