ADD: Changed to a stack implementation for nodes