Replaced IF Statement with Case Statement