Use finite functions to get true count of cells, cleanup functions