modified newNode

- move newNode' and checkNextEdge to the where clause of the newNode.
- bugfix, updating pends in the checkNextEdge.