Improved Halo_Master PERL script