use R6 class; remove data first and last elements --> simplify