Refactored save

Works from the outside now.