Not sure how important performance is, but you might want to use a hashmap here