wrote new bin assignment algo