Improved code example about memory spooling