Added sorting to code complete