added support for lone surrogates in the ungolfed version