Added sorting of backlinks before writing to csv