         var stop = false
         _startIterator(iterator, backward: backward, prefix: prefix, start: key)
         while levelDBIteratorIsValid(iterator) {
-            
             var iKey: UnsafeMutablePointer<Int8> = nil
             var iKeyLength: Int = 0
             levelDBIteratorGetKey(iterator, &iKey, &iKeyLength)

    
    private func _startIterator(_ iterator: UnsafeMutablePointer<Void>, backward: Bool, prefix: String?, start key: String?) {
        var startingKey: String
        //if let prefix = prefix {
        if let prefix = prefix {
            startingKey = prefix
            if let key = key {

            // we need to start on the next key (maybe discarding the first iteration)
            if backward {
                var i: Int = len - 1
                let startingKeyPtr = UnsafeMutablePointer<UInt8>(malloc(len))
                memcpy(startingKeyPtr, startingKey.cString, len)
                var keyChar: UnsafeMutablePointer<UInt8> = startingKeyPtr
