An extended Zel'dovich model for the halo mass function