pulled some list.cc code into repository, so that list's internal swap function can be made safe