added dshift, dtype-safe shift