Some memory usage improvements
Merge pull request #2 from wymsee/memory

Some memory usage improvements