added more logic to parsing questions