Renamed variable flag to cellPointer. Moved logic for check isLineMoved