program working for the entire corpus