wip memory management and streams