Removing extra lines after 'do'