minor change in greedyAction()