added simplex optimization