revised JS