works with small numbers on 0 loss