made sorting and printing data much shorter