Modifying data structure

change resources from list to dictionary and make necessary changes in other functions