Hacked together a more memory efficient variance routine to avoid out of memory issues.