Implemetation of generic data structure