Working index implementation, and ording sorted