implemented proper delete on tree