Added list iterator, cleaned up code, and fixed a memory leak.