Added variance per issue #1

Also moved most of the math out of stdev.