added save()
added OSX support