changed list functions to take pointers, to avoid copy reallocate and/or double indirection pains