removed redundant functions in functions.js