Added cost function and more constraints
Some more constraints