CodeGate2012 writeup