then , either through the frantic efforts of the electrician struggling with the controller or through another change in the polarity of the comet , the ship would be saved on the very brink of ruin and stagger away out of immediate danger .