adds sort_by_name method to List class