generatic function for dirac