Moved Javascript into external file