Updated RMSE function