optimized

fun optimized(parent: Pos, p: Int = 0): Pos