added cmd line options
added tolerance check, and interrupt handler
Pulled latest cose from master