why do you iterate over columns (pos, width), too, if all you want is scan lines?