redid getProgramStages() function