Add getWinnerId function, refactor testing