refactored setupNodesAndLinks. New function for setting up box links