This is stack implementation