depth based search for delete and addition