Re-use code for finding RMS and calculating power