added min_stack. Memory limit exceeded.