Getting closer, but still have a memory leak