merge duplicate lines