Added cleanup so that each simulation trial cleans up after the previous one.