Codes for NMF