Puzzle solving algorithm now works, it was wrong to only test 3 out of 4 possible twists in each node.