first cut of main.cpp