formal definition of the tuning problem, develops a generic algorithm for tuning