moved prev and next pointers to fix cell size calculation bug