Implementation of all data structures