Added team win detection and new score functions.