preparing index