You should do a structural recursion on the list.