memory improvements
Merge pull request #151 from obourgain/memory-consumption

memory improvements