integrated memory-use changes by ralfbrown (issue #12)