implement link_stack with head as top