main: added a pause function, few other fixes