fixed the 0 case in iterative