Added method of clearing tree
Changed validation check before insertion and retrieval