added custom functions to JS, added reference file