recursive version of levenshtein algorithm using only immutable lists