updated svd to only run once