Change to sorted index