made threshold structure and fixed checkdata
Merge pull request #34 from Callum-/master

made threshold structure and fixed checkdata