some modifications for testing memory usage.

Found to_excel is the memory hog.