added main.cc for direct testing