working q2 solution, but still slow
branch and bound solution, runs much faster