Calculating Expected Value and Standard Deviation