Unused imports removed + sort bug fix