added prob1 for greedy algo