knowc outer loop working