added calculation for moving rating cost function without regularization