working further on datastructure functions