experimenting with C and memory and stuff. keep having problems with memory leaks using std::list in c++, among other things