Sample code from scorecard javascript file