shifted constants inside the function, written up the cost function to be used in optimization