write Associativeadd and treesimplify method and write tests for both