Added code for the finals.