Added JS functions to the prototype