working on spider function