Added recursive implementation of the prereq tree