for (k=0; k < 140; j++) {
This will never increment 'k' so the loop will never end. It will repeat with k=0 forever.