start|pause|resume logic implemented; control button added; output added;