Better docs-- also smashed a few sneaky globals.