Calculation....Pre-(complete double)

Note: I changed the 2 values for the RMS to double instead of long