Added new interface for threshold.
Added test function to global threshold.
Modifications from the laptop added as backup.
Merge branch 'github/develop'