sample code of queue representation
done with exercise 3.21 and 3.22