added some unit tests, rearranged tree a little
resolved merge conflict