added --resume parameter to resume from a particular point