Now using if-else instead of dict.get because if-else is faster.