Made integration more generic, more tests. Idea of adjust tree not working