wrote function to search all levels of the dom