Holy shit it works! Converted all test cases.