Added sorting arrows; Code cleanup