Refined numBytes and removed unnecessary slicing.