improved mse calculation