update Stack datastructure