how can I make my program to freeze in certain conditions .. unless I click "r" it will continue to work ?