re-organized a bit;
added defines to make it easier to test on another machine;
made sure tests succeeded;