Moved everything into main.cc temporarily