Fixed some bugs, reset ps code back to original since fix produced an infinite loop, and added almost done jobsgroup code