add better version function, fix some os stuff, add persistance functionality