finished implementation of SoftMax algo