Updated countChange to use matching instead of a lot of if-then-elses