add step 2 and step 3
adapt the code to the new extension and plotName options