Added type signature to `valid`