Proper output, use stacks