updated js file to finish preloading arrays