changed csv storage from list to dictionary format