Used dict.get to avoid having to catch exceptions