fine tune stack queue and bag