Changes to closing funcitons. Not tested.