updated plotting functions with bins