switched from queues to stacks in bmem