First draft of the appendList code (untested)