I am looking to implement a greedy acitivity selector algorithmn, but the trick is, instead of the first job being selected, it\'s the last one selected. this is what i have