be careful about using string.find(), you got an O(n^3) algorithm..