basic code for collective matrix factorization, untested