+added host code as well and restored original main.cpp