Hrrrmmm, also confused what this loop is doing.  Is it just removing all the lines for some reason?