calculating R,T instead of a