question answer logic