Cleaned up the svd routine to be more consistent with the rest of the code