added "ReadModes" to read and setup a list of modes
added Optimize.c, which tries to optimize 2nd threshold. So far appears to be working