add computeYHAT() function