extension Collection { subscript(safe index: Int) -> Element? { indices.contains(index) ? self[index] : nil } }