Changed to have a map dictionary instead of a ton of ifs.
Changed to have an encode private static dictionary.