Sujit: changed the way the file progress is calculated, added more logging