Added createLink and createNode functions and made changes in main.cpp to use them.