GenerateLines does not work. NullPointerException, line 171