modify GreedyMRSLarge to handle when z < k