My code for the catalyst coding contest 2014 in linz