Finished implementation of chk_term