more work on heap management