add shape tree and test for it