added funtion's prototypes
index intersection