Sorts and add tabwriter
Implements sorting