Adding the code that was in application.js to predictor.js