Started adding the bin based counting algorithm