Solution to Simple sort challenge on CodeEval