getConstraints
loss function fixes