implementation of useful data structures