Added sorting, WIP on getting item's indexes