restructuring of file retrodefrom and adding some comments