Added tree method, needs some work though