EUREKA BITCHES

It works for the two simple test cases we tried