ttrying to optimize memory alocation, keeping only alive cells