Fixing the naive version of line 6