implementing algorithm A
adding set constraints to mk
implemented extracto