small change to the function to avoid errors in case of an empty input string
played around..
first very simple working version of the prediction algorithm as a shiny app