with a hashmap above, you wouldn't need this loop.