         }
 
         var array: [UInt8] = Array(repeating: 0, count: count)
+        var byte = self.data[self.index]
         for i in 0..<count {
-            array[i] = self.data[self.index] & self.bitMask > 0 ? 1 : 0
+            array[i] = byte & self.bitMask > 0 ? 1 : 0
 
             switch self.bitOrder {
             case .reversed:
                 if self.bitMask == 128 {
                     self.index += 1
+                    byte = self.data[self.index]
                     self.bitMask = 1
                 } else {
                     self.bitMask <<= 1

        }

        var result = 0
        for i in 0..<count {
            let power: Int
            switch self.bitOrder {

            case .straight:
                if self.bitMask == 1 {
                    self.index += 1
                    byte = self.data[self.index]
                    self.bitMask = 128
                } else {
                    self.bitMask >>= 1
