change StartMainLoop signature and add InputLine