added main.cpp for exercise 2