data structure implementation