Handling case of continuous filled cols &rows

in this case we have to jump to the continuously last filled column or
row