implemented caret line unwrapping