Somewhat working. I still need to debug the successors function since it is giving wrong transforms.