now trims leading and ending newlines before processing