Pass even? or odd? as test? to simplify the logic in iter