check_periodn() function. closes #15