lddynamic optimization working