Apparently working dynamic optimization.