revise trim_start and trim_end to check each row and delete_if