added license and updated main.cpp