Added save figure option + general cleanup