Don't recurse in bin-packing algorithm
Further tidy bin-packing code