Modified and improved next_cell() function

Now it returns a boolean and modifies the original cell.