adding code for cutting tree