cleaning up and hunting for memory problems...