histogram script from bin guan