Some changes to adapt the code to my workflow.