added average and stdlosses to outputs