Bug fix preventing operation when computing/retrieving SIGMA.
Added lots of functionality and fixed bugs.