defining function and variable to handle tropism