Added new auto-tuning code