updating main.cpp to stack assignment