My solution for the CodeEval challenges