corrected bug in main_global_bits