Ranking and constant sum fork javascript template