moved the code out to scorecard.js