Adding the rest of the js code