Changes to loss function and data