This is a standard deviation algorithm.  This will include a copy of my variance class instead of a reference to that project due to readability.