example working with simplex and square function