code works for small strings