Put some syntax improvements.
Create window tool for regulation of threshold.