draft auto tuning code