Added delete nan lines function