Added Matrix Factorization for general case