reverse iterate through dependencies instead of reversing the element in the array