Added the code used in the competition.