scaling for forward algorithm