added linking functions to JS