 			else
 				@server.send(message)
 
-		# Sets a peer as the parent node of this node.
-		#
-		# @param peer [Peer] the peer to set as parent
-		# @param callback [function] is called with a parameter if a node is accepted or not
-		#
-		setParent: ( peer, callback ) ->
-			peer.query('peer.requestParent', @id, ( accepted ) =>
-				if accepted
-					@_parent?.emit('peer.abandonParent')
-					@_parent?.role = Peer.Role.None
-					peer.role = Peer.Role.Parent
-					@_parent = peer
-
-				callback(accepted)
-			)
-
-		# Returns the parent peer of this node.
-		#
-		# @return [Peer] the parent peer
-		#
-		getParent: ( ) ->
-			return @_parent
-
-		# Adds a peer as child node.
-		#
-		# @param peer [Peer] the peer to add as child
-		#
-		addChild: ( peer ) ->
-			if peer is @_parent
-				@_parent = null
-			peer.role = Peer.Role.Child
-			if @getChildren().length > 4
-				_(@generateToken).defer()
-
-		# Removes a peer as child node. Does not automatically close 
-		# the connection but will make it a normal peer.
-		#
-		# @param peer [Peer] the peer to remove as child
-		#
-		removeChild: ( peer ) ->
-			peer.role = Peer.Role.None
-			@_triggerStaySuperNodeTimeout()
-
-		# Returns a child specified by an id
-		#
-		# @param id [String] the id of the requested child
-		# @return [Peer] the child
-		#
-		getChild: ( id ) ->
-			return @getPeer(id, Peer.Role.Child)
-
-		# Returns all current child nodes.
-		#
-		# @return [Array<Peer>] an array of all child nodes
-		#
-		getChildren: ( ) ->
-			return @getPeers(Peer.Role.Child)
-
-		# Adds a peer as sibling node.
-		#
-		# @param peer [Peer] the peer to add as sibling
-		#
-		addSibling: ( peer, instantiate = true ) ->
-			if peer is @_parent
-				@_parent = null
-
-			peer.role = Peer.Role.Sibling
-			if instantiate
-				peer.emit('peer.addSibling', @id)
-
-		# Removes a peer as sibling node. Does not automatically close 
-		# the connection but will make it a normal peer.
-		#
-		# @param peer [Peer] the peer to remove as sibling
-		#
-		removeSibling: ( peer ) ->
-			peer.role = Peer.Role.None
-
-		# Returns a sibling specified by an id
-		#
-		# @param id [String] the id of the requested sibling
-		# @return [Peer] the sibling
-		#
-		getSibling: ( id ) ->
-			return @getPeer(id, Peer.Role.Sibling)
-
-		# Returns all current sibling nodes.
-		#
-		# @return [Array<Peer>] an array of all sibling nodes
-		#
-		getSiblings: ( ) ->
-			return @getPeers(Peer.Role.Sibling)
-
 		# Applies Vivaldi algorithm. Calculates the coordinates of a node
 		#
 		_updateCoordinates: ( ) =>

			randomChild = children[_.random(0,children.length-1)]
			randomChild.emit('token.add',token.serialize())
			console.log  randomChild.id +  ' received a token'
			
		# Is called when a node receives a token from another Node
		#	
		# @param peer [Peer] The last routing peer
		# @param tokenString [String] A serialized token
		#
		_onTokenReceived: ( peer, tokenString ) =>
			@token = Token.deserialize(tokenString)
			@removeToken(@token)
			@token.nodeId = @id

			@broadcast('token.hop', @token.serialize(), @coordinates.serialize(), true)
			@_tokenRestTimeout = setTimeout(( ) =>
				@_calculateTokenMagnitude()
			, @broadcastTimeout)
			@timers.push(@_tokenRestTimeout)

			# Is called when a token hops. Sends a token information to the initiator
		#
		# @param peer [Peer] The last routing peer
		# @param tokenString [String] A serialized token
		# @param vectorString [String] Serialized coordinates of the holder of the token
		#
		_onTokenInfo: ( peer, tokenString, vectorString, instantiate = true ) =>
			token = Token.deserialize(tokenString)
			console.log "Received info about token ", token
			token.coordinates = Vector.deserialize(vectorString)
			@addToken(token)
			if @token? and instantiate
				@emitTo(token.nodeId, 'token.info', @token.serialize(), @coordinates.serialize(), false)

		# Adds a token to the collection of foreign tokens
		#

			@coordinates = new Vector(Math.random(), Math.random(), Math.random())
			@coordinateDelta = 1
			
			@_peers.on('disconnect', @_onPeerDisconnect)
			@_peers.on('peer.addSibling', ( peer ) => @addSibling(peer, false))
			@_peers.on('peer.setSuperNode', @_onPeerSetSuperNode)
			@_peers.on('peer.parentCandidate', @_onPeerParentCandidate)
