change data structure to hash