break out stack functions to separte file