Put JS in it's own file and updated the JS file to not use array