added a generalized version of the MC problem