use spooling for very large limit case
Merge pull request #330 from maryannxue/iss322

Fix issue #322