making stack a function so it loads properly?