added the S/N calculations