TOLD, TNEW commands added. code cleanup