Remove the js functions into separate file TDLSfunctions.js and begin outline of needed functions