implementing bin pack problem with best and worst fit heuristics