adding file io and test
save load
working code