stages.cpp