made improvements to the prune function as well as now the mutation
functionality is working correctly.

I had to keep track of the parent nodes of each node, in order to be
able to mutate them