building data structures from scratch