We have a non-empty list called `authList` that stores the names of all authors in the "Library" table sorted by alphabetical order of author name. Every book in the table creates an entry in `authList` for each of its authors. This results in many duplicates in `authList`. The following procedure attempts to extract the unique list of authors, while preserving the sorted order. The pseudocode may have mistakes. Identify all such mistakes, if any.
```
uniqueList = []
uniqueList = uniqueList ++ [last(authList)]
prev = first(authList)
foreach x in rest(authList) {
if(x == prev) {
uniqueList = uniqueList ++ [x]
}
prev = x
}
```