Removed some magic strings and pathnames
Added a save figure function