trim the result, not the input, and get better results