correctly adding the child nodes into the queue inside their respective parents