thaw function, untested