Added function to generate R1T