Added functions in JavaScript