add leaderboard, refactor javascript