trying to manipulate the lists in a function