added main.cpp for dynamic solver