code working smoothly, included set_leg_areas under set_constansts of te_pair, added some optmz codes