string now geos on heap instead of stack
Optimized inner loop to 3 lines