2nd revision of the codeeval.com solutions