Setting up basic objective function and constraints.