Seeing what you have coded/knowing all of what you need from the trees would help with getting an answer.