newNode function
refactor. more general and better
got some nice tests
coverage