made threshold structure and fixed checkdata