Writing the Unserialize method.