remove unnecessary goto
add bad doc
improve getadjacentnode by removing unnecessary up stack when it can be calculated inline
ifukmn