update with dsample code