updated getBins operation