     func alignedByte() -> UInt8 {
         self.skipUntilNextByte()
         self.index += 1
-        return self.bitArray[self.index - 1]
+        return self.data[self.index - 1]
     }
 
     func alignedBytes(count: Int) -> [UInt8] {
         self.skipUntilNextByte()
         var result: [UInt8] = Array(repeating: 0, count: count)
         for i in 0..<count {
-            result[i] = self.bitArray[self.index]
+            result[i] = self.data[self.index]
             self.index += 1
         }
         return result

        self.skipUntilNextByte()
        var result = 0
        for i in 0..<count {
            result |= self.bitArray[self.index].toInt() << (8 * i)
            self.index += 1
        }
        return result

    }

    func bit() -> Int {
        let bit = self.data[self.index] & self.bitMask > 0 ? 1 : 0

        switch self.bitOrder {
        case .reversed:
