refactored everything. added save