switch from hash to list and define a struct for storing the data