Remove k in the inner loop, change for j+1

change k for j+1