Procedural implementation of queue and stack.