sampling funtions integrated