Added options to specify first page and last page to process