add new loss functions and tests