updated main.cpp and Makefile