Changed from Switch/case to if/elseif to save some runtime ram