while inp and out ok