Added sorting and printing for large file.