 		
 		let minimum = array.first!
 		array[0] = array[array.count - 1]
+		weights[0] = weights[weights.count - 1]
 		array.removeAtIndex(array.count - 1)
+		weights.removeAtIndex(weights.count - 1)
 		
 		elementsToPositions.removeValueForKey(minimum)
 		

			let leftChildIndex = _leftChildIndex(startIndex)
			let rightChildIndex = _rightChildIndex(startIndex)
			
			let leftChild: T? = leftChildIndex < array.count ? array[leftChildIndex] : nil
			let rightChild: T? = rightChildIndex < array.count ? array[rightChildIndex] : nil
			
			var smallerChildIndex: Int
			

		}
	}
	
	private func _swapElements(a: Int, _ b: Int) {
		let elementA = array[a]
		let elementB = array[b]
		
		let weightA = weights[a]
		let weightB = weights[b]
		
		array[a] = elementB
		array[b] = elementA
		
		weights[a] = weightB
		weights[b] = weightA
		
		elementsToPositions[elementA] = b
		elementsToPositions[elementB] = a
