change else if to elseif to maintain consistency throughout