Adding of Functions

Adding the functions and call to function code to javascript file