Seperated the JS from the HTML

Made two new js files