Optimal design of health insurance plans