cant get normal values out of HTU21d

I have an HTU21d sensor and I am getting data out of it. But the numbers I am getting are make little sense to me. I have been reading the datasheet all day and I can't see what I am doing wrong.

#include <Wire.h>
#define HTU21D 0x40

uint16_t temperature = 0, humidity = 0;
byte x;

void setup() {
  Wire.begin();
  Serial.begin(115200);
}

void loop() 
{
  delay(1000);
  Wire.beginTransmission(HTU21D);
  Wire.write(0xE3);              // temperature register with hold master
  Wire.endTransmission(false);
  Wire.requestFrom(HTU21D, 2);   // 8 bit MSB + 6 bit LSB
  if (Wire.available()) temperature = Wire.read() << 6  | Wire.read() >> 2;
 

  Wire.beginTransmission(HTU21D);
  Wire.write(0xE5);             // humidity register with hold master
  Wire.endTransmission(false);
  Wire.requestFrom(HTU21D, 2);  // 8 bit MSB + 6 bit LSB
  if (Wire.available()) humidity = Wire.read() << 6 | Wire.read() >> 2;
  
  
  humidity = -6 +(125 * (humidity / 65536);              // these calculations come from the datasheet
  temperature = -46.85 + 175.72 * (temperature / 65536);

  Serial.print(temperature); Serial.print(" "); Serial.println(humidity);
}

I have enclosed a page of the data sheet. The data should consist out of the 8 bit MSB and the 6 bit LSB. that is why I shift the LSB with >> 2 and the MSB with << 6. I dont understand what I have to do with the 2 status bits and the checksum. But I am getting a temperature of 0 and a humiditity of 65530

I do not want to use that HTU21 library.

I figured out what the problem was

[#include <Wire.h>

byte MSB_temp, LSB_temp, MSB_vocht, LSB_vocht;
uint16_t temperature, humidity;

void setup() \
{
  Wire.begin();
  Serial.begin(115200);
}

void loop() {
  Wire.beginTransmission(0x40);
  Wire.write(0xE3);
  Wire.endTransmission(false);  // restart condition
  Wire.requestFrom(0x40, 2);    // request 2 bytes
  if (Wire.available()) {
    MSB_temp = Wire.read();
    LSB_temp = Wire.read();
  }

  temperature =  (MSB_temp << 8) | (LSB_temp & 0b11111100);
  temperature = -46.85 + 175.72 * ((double)temperature / 65536);

  Wire.beginTransmission(0x40);
  Wire.write(0xE5);
  Wire.endTransmission(false);  // restart condition
  Wire.requestFrom(0x40, 2);    // request 2 bytes
  if (Wire.available()) {
    MSB_vocht = Wire.read();
    LSB_vocht = Wire.read();
  }

  humidity =  (MSB_vocht << 8) | (LSB_vocht & 0b11111100);
  humidity = -6 + 125 * ((double)humidity / 65536);
  
  Serial.print("temperature = "); Serial.print(temperature);
  Serial.print(" humidity= "); Serial.println(humidity);
  delay(500);

}

I had to use a type conversion before I put the read value in the calculation.

I find it odd that I coudln't find one single demo sketch which does not use that pre-fab library. The code to get the sensor data is not even that complicated and that datasheet gives enough information. I wonder why a libary is written for the HTU21D in the first place.