adding innerhtml every iteration now, instead of all at once