codes for binary matrix factorization