Added debug option which doesn't remove intermediate files