Sorting and removing duplicates

Signed-off-by: Gerco van Heerdt <gercovanheerdt@gmail.com>