`val` -> `numShifts` (if I guessed correctly)