added ajax to count wins and losses