add cell border and adjust memory ownership of static variables