Updated my nextProcessEC() function to have better performance by not going through the foor loop in the 1st IF statement if cur_proc has been reset.