working, todo save to file, tests, refactor