Complete the function which can remove index positions.