added tests in main.cpp