tuning code