Variance stuff

Translating from IDL