chk_length function

Check Length