adding functions in javascript