Attempting to use the C++ stack.
Added explainitory comment.