Checknig function generation.