adding functions to javascript