working on internal binnning