Changed so that all steps (including saving) happen in the local directory. This should allow for simpler portability.