Updated algorithm of moving cells