Completed removeLeaves