list.cpp add function works