Arash Sharif's bin packing code