Moved add cell code