Added the solution to stack1