edit bestPath bestPathStarting k < length x