fixed save related code and test
added .gitignore