make into one function addNode