fix tour and preliminary optimizations