 public class ValueArray<ElementType : CustomStringConvertible> : ContiguousMutableMemory, MutableCollectionType, ArrayLiteralConvertible, CustomStringConvertible {
     public typealias Index = Int
     public typealias Element = ElementType
-    
-    private var buffer: ManagedBuffer<(Int, Int), Element>
 
-    public var count: Int {
-        get {
-            return buffer.value.0
-        }
-        set {
-            buffer.value.0 = newValue
-        }
-    }
-
-    public var capacity: Int {
-        return buffer.value.1
-    }
+    public internal(set) var mutablePointer: UnsafeMutablePointer<Element>
+    public internal(set) var capacity: Int
+    public var count: Int
 
     public var startIndex: Index {
         return 0

}

public func ==<T where T : Equatable>(lhs: ValueArray<T>, rhs: ValueArray<T>) -> Bool {
    for (a, b) in zip(lhs, rhs) {
        if a != b {
            return false
        }
    }
    return true
}

public func swap<T>(inout lhs: ValueArray<T>, inout rhs: ValueArray<T>) {
    swap(&lhs.buffer, &rhs.buffer)
}

        return 1
    }

    public var pointer: UnsafePointer<Element> {
        return UnsafePointer<Element>(mutablePointer)
    }

    /// Construct an uninitialized ValueArray with the given capacity
    public required init(capacity: Int) {
        mutablePointer = UnsafeMutablePointer<Element>.alloc(capacity)
        self.capacity = capacity
        self.count = 0
    }

    /// Construct an uninitialized ValueArray with the given size
    public required init(count: Int) {
        mutablePointer = UnsafeMutablePointer<Element>.alloc(count)
        self.capacity = count
        self.count = count
    }

    /// Construct a ValueArray from an array literal
    public required init(arrayLiteral elements: Element...) {
        mutablePointer = UnsafeMutablePointer<Element>.alloc(elements.count)
        self.capacity = elements.count
        self.count = elements.count
        mutablePointer.initializeFrom(elements)
    }

    /// Construct a ValueArray from contiguous memory
    public required init<C : ContiguousMemory where C.Element == Element>(_ values: C) {
        mutablePointer = UnsafeMutablePointer<Element>.alloc(values.count)
        capacity = values.count
        count = values.count
        for var i = 0; i < count; i += 1 {
            mutablePointer[i] = values.pointer[values.startIndex + i * step]
        }
    }

    /// Construct a ValueArray of `count` elements, each initialized to `repeatedValue`.
    public required init(count: Int, repeatedValue: Element) {
        mutablePointer = UnsafeMutablePointer<Element>.alloc(count)
        capacity = count
        self.count = count
        for i in 0..<count {
            self[i] = repeatedValue
        }
    }

    deinit {
        mutablePointer.dealloc(capacity)
    }

    public subscript(index: Index) -> Element {
