restored data structure, finished main function, added heper functions. whole file compiles. haven't run yet.