Implement the major data structures