Delete unnecessary rows