logic for questions