code for initial SVD decomposition