addnode and link functions
addnode and link functions