Adding function to the index