Non recursive attempt.