used dot sort_by method to refactor my previous code on ClassDataAnalysis