Added tree search. Not sure if it's supposed to always be stuck in an infinite loop.