working caret insertion
working caret insertion
working count of position in text, but be careful with empty characters; should ignore them/trim in the future