Recursive version of DecodeWays