small part of Stack and Queue implementation