`quit` normally is a boolean flag.  Having it as none is a little strange.  If it is supposed to be a max count then call it something like `nmax` or `max_count`.