generic functions written