stack and its application