Please use a lookup table instead of this series of ifs.