modified linear data structures, nearly finished