Nearly done, memory cleanup todo.