refactored main() to prepare for code generation from hints