original code of rtt_1.2.2