fix more bugs in program