My runner-up entry for 2013 Openet Coding Competion.