found a maybe not minor mistake in the for loop in setting j=start with noninitialized start