queue implementation. working proto