Added stuff for stack and trees