refactored to show only one statement at a time