switched to pipeiter, fixed mistake in exit cond.