interaction code with functions