partition problem difference method added