updated with hashmap storage