QSD updateds

Changed survMat for matU and tidied up a bit the code