designing the data structures and associated APIs