implement basical dalgen function