Converted elo.py to js