. . . "pointed out that detention for improper ends is, in itself, a form of penalty" .