modified softmax to run faster