         var o : AnyObject = 0
 
         if c == "s" {
-            o = objectsQueue.popLast()!
+            o = objectsQueue.removeFirst()
 
             guard let stringData = (o as! String).dataUsingEncoding(stringEncoding) else { assertionFailure(); return NSData() }
             var bytes = stringData.bytesArray()


func pack(format:String, _ objects:[AnyObject], _ stringEncoding:NSStringEncoding=NSWindowsCP1252StringEncoding) -> NSData {
    
    var objectsQueue = Array(objects.reverse())
    
    var mutableFormat = format
    

            var bytes : [UInt8] = []

            if c != "x" {
                o = objectsQueue.removeFirst()
            }
            
            switch(c) {
