composed main.cc from numatest.cc