Checking number with function and main