Bug fixes, now works in Kattis

Fixed the problem with wrong answer in Kattis (before it thought no
solution was found if the queue was empty after polling a node)
commit
Merge branch 'master' of https://github.com/carolinemagnusson/Amazingqwerty