 			comment = @getComment(comment_id)
 			return if !comment?
 			@comments = @comments.filter (c) -> c.id != comment_id
-			@emit "comment:removed", comment
-		
+			@_markAsDirty comment, "comment", "removed"
+		
+		moveCommentId: (comment_id, position, text) ->
+			for comment in @comments
+				if comment.id == comment_id
+					comment.op.p = position
+					comment.op.c = text
+					@_markAsDirty comment, "comment", "moved"
+
 		getChange: (change_id) ->
 			change = null
 			for c in @changes

						change.op.p += op_length
						moved_changes.push change
					else if op_start == change_start
						# If the insert matches the start of the delete, just remove it from the delete instead
						if change.op.d.length >= op.i.length and change.op.d.slice(0, op.i.length) == op.i
							change.op.d = change.op.d.slice(op.i.length)
							change.op.p += op.i.length
							if change.op.d == ""

					previous_change = change
			return { moved_changes, remove_changes }
		
		resetDirtyState: () ->
			@_dirtyState = {
				comment: {
					moved: {}
					removed: {}
					added: {}
				}
				change: {
					moved: {}
					removed: {}
					added: {}
				}
			}
		
		getDirtyState: () ->
			return @_dirtyState
		
		_markAsDirty: (object, type, action) ->
			@_dirtyState[type][action][object.id] = object
		
		_clone: (object) ->
			clone = {}
			(clone[k] = v for k,v of object)
			return clone

if define?
	define [], load
else
	module.exports = load()
