changed to structure in main to a hash