now works with longer strings