1. You're assigning the return value of
func, but it will not return a function, but an array.
2. There is no point in the inner
for-loop, since you return instantly anyway.
3. This code implies that
flight is an array of arrays, is that correct?