Minor: can also do `for (i <- 0 until apps.size; if !found) { ... }`