Trying inside nested loop