everything but the last problem done
complete, but need more tests for deleteLeaves