Completely update. Changed almost everything to work with cursor position
instead of splitting the string.