advanced data structure implementation