Reverse logic in loop. Ambiguous problem statement.