Changed output to be sorted
Deleted legacy package
Fixed minor issues in unit tests