implement continuation
before minimize function