Function resolveBins