with correct sort