   in: (s) ->
     @startPos.lt(s) and @endPos.gt(s)
 
+  # Returns true if the current selection is in the given selection
+  #
+  # @param [Selection] s the selection to compare to this
+  #
   contains: (s) ->
     s.in(@)
 
+  # Returns true if the given selection overlaps the current selection
+  #
+  # @param [Selection] s the selection to compare to this
+  #
   overlaps: (s) ->
     @startPos.lt(s.endPos) or @endPos.gt(s.startPos)
 
   #TODO
-  setStyle: (@style) ->
-
+  setAttr: (@attr) ->
+
+  # Create a copy of the selection
+  #
   clone: ->
-    new Selection(@startPos, @endPos)
-
+    new Selection(@startPos, @endPos, @style)
+
+  # Validate a selection if the start is before the end of the selection
+  #
   isValid: ->
     @startPos.lt(@endPos)
 
 
-  # Try to merge this selection with the one given in argument
-  #
-  merge: (s, rte) ->
-    # Check if they're contiguous
-    if s.endPos.word == @startPos.word or
-       (s.endPos.word == @startPos.word -1 and
-        s.endPos.loc == rte.getWord(s.endPos.word).length() and
-        @startPos.loc == 0)
-      # boundaries of new selection
-      start = s.startPos
-      end = @endPos
-      # remove link of middle words to selection
-      rte.getWord(s.endPos.word).removeSel(s)
-      rte.getWord(@startPos.word).removeSel(@)
-    else if @endPos.word == s.startPos.word or
-       (@endPos.word == s.startPos.word -1 and
-        @endPos.loc == rte.getWord(@endPos.word).length() and
-        s.startPos.loc == 0)
-      start = @startPos
-      end = s.endPos
-      rte.getWord(@endPos.word).removeSel(@)
-      rte.getWord(s.endPos.word).removeSel(s)
+# Class describing the Rich Text Editor type
+#
+class Rte
+  # @property [Options] _rte the RTE object
+  # @param [String] content the initial content to set
+  # @option _rte [Array<Selection>] selections array containing all the current selections
+  # @option _rte [Array<String>] words array containing all the words of the text
+  #
+  constructor: (content = '')->
+    if content.constructor is String
+      @_rte = {}
+      @_rte.styles = []
+      @_rte.selections = []
+      @_rte.cursorInformation = {}
+      @_rte.words = []
+      @push(content)
     else
       return
 

      c.constructor is "Rte"

      [@startPos, @endPos] = @_relativeFromAbsolute(a, b, c)
      style = d

    else if a? and b? and a.pos? and a.word? and b.pos? and b.word?
      @startPos = a


    [{word: spw, pos: spp}, {word: epw, pos: epp}]

  # Compares the bounds of two selections
  #
  # @param [Selection] s the selection to compare to this
  #
