Replaced else if() with elseif() as advised for conformity.