Branch and bound program mostly working