added clip lines function