fixed histogram calculation and added scatter histogram script