use stack to achive a fifo