removes unnecessary lines