closes #3 implements moving threshold model